home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1997 February / macformat-047.iso / Demos / Picasso Interactive Demo / Data / analyse.Dxr / Internal_31.ls < prev    next >
Encoding:
Text File  |  1996-12-04  |  12.9 KB  |  312 lines

  1. on mouseUp
  2.   global g_analyse_status, g_analyse_sprite_picto_retuniv, g_analyse_sprite_picto_txtcomp, g_analyse_sprite_picto_manitool, g_analyse_sprite_picto_biblio, g_nbtxtcomp, g_numtxtcomp, g_biblio_actif, g_txtcomp_store_num, g_txtcomp_store_nb, nomimage, g_analyse_lien_dico, g_analyse_context, g_visite, g_call_param, g_next_movie, g_exit, g_countcast
  3.   cursor(-1)
  4.   if g_visite = 0 then
  5.     if g_analyse_status > 0 then
  6.       exit
  7.     end if
  8.     if rollOver(g_analyse_sprite_picto_retuniv) then
  9.       set g_analyse_status to 1
  10.       set g_analyse_context to [nomimage, 3, g_nbtxtcomp, g_numtxtcomp]
  11.       set g_call_param to -1
  12.       set g_exit to 0
  13.       unpuppet()
  14.       go("sortie")
  15.     else
  16.       if rollOver(g_analyse_sprite_picto_txtcomp) then
  17.         if g_nbtxtcomp > 0 then
  18.           set g_analyse_status to 3
  19.         else
  20.           set g_analyse_status to 2
  21.         end if
  22.       else
  23.         if rollOver(g_analyse_sprite_picto_manitool) then
  24.           set g_analyse_status to 1
  25.           set g_call_param to nomimage
  26.           set g_analyse_context to [nomimage, 3, g_nbtxtcomp, g_numtxtcomp]
  27.           set g_exit to 1
  28.           set g_next_movie to "manimaj"
  29.           set liste_clef to ["A20", "B31", "C30", "D40", "E30", "F00", "F01", "G40", "H00", "H40", "I10", "J10", "K10", "L00", "M10", "M30", "N10", "O10", "P20", "Q20"]
  30.           repeat with i = 1 to 20
  31.             if nomimage = getAt(liste_clef, i) then
  32.               if the machineType = 256 then
  33.                 set g_next_movie to the pathName & "MANI\M" & nomimage
  34.               else
  35.                 set g_next_movie to the pathName & "MANI:M" & nomimage
  36.               end if
  37.               exit repeat
  38.             end if
  39.           end repeat
  40.           unpuppet()
  41.           go("sortie")
  42.         else
  43.           if rollOver(g_analyse_sprite_ap) then
  44.             set g_analyse_status to 1
  45.           else
  46.             if rollOver(g_analyse_sprite_picto_biblio) then
  47.               if g_biblio_actif = 0 then
  48.                 set g_analyse_status to 5
  49.                 set g_biblio_actif to 1
  50.                 set g_txtcomp_store_num to g_numtxtcomp
  51.                 set g_txtcomp_store_nb to g_nbtxtcomp
  52.               else
  53.                 set g_analyse_status to 6
  54.                 set g_numtxtcomp to g_txtcomp_store_num
  55.                 set g_nbtxtcomp to g_txtcomp_store_nb
  56.                 set g_biblio_actif to 0
  57.               end if
  58.             else
  59.               if g_nbtxtcomp > 0 then
  60.                 if rollOver(g_analyse_sprite_picto_avatxt) then
  61.                   set g_numtxtcomp to g_numtxtcomp + 1
  62.                   set g_analyse_status to 4
  63.                 else
  64.                   if rollOver(g_analyse_sprite_picto_rettxt) then
  65.                     set g_numtxtcomp to g_numtxtcomp - 1
  66.                     set g_analyse_status to 4
  67.                   end if
  68.                 end if
  69.               end if
  70.             end if
  71.           end if
  72.         end if
  73.       end if
  74.     end if
  75.     if g_analyse_lien_dico <> EMPTY then
  76.       message_d7()
  77.       set g_analyse_lien_dico to EMPTY
  78.     end if
  79.   else
  80.     set g_call_param to -1
  81.     set g_exit to 0
  82.     unpuppet()
  83.     go("sortie")
  84.   end if
  85. end
  86.  
  87. on mouseDown
  88.   global g_call_param, g_visite, g_exit
  89.   if g_visite = 1 then
  90.     set g_call_param to -1
  91.     set g_exit to 0
  92.     unpuppet()
  93.     go("sortie")
  94.   end if
  95. end
  96.  
  97. on exitFrame
  98.   global g_analyse_sprite_picto_retuniv, g_analyse_sprite_picto_manitool, g_analyse_status, g_analyse_sprite_aa, g_analyse_sprite_at, g_analyse_sprite_ap, g_analyse_sprite_ak, g_xlib_xfile, nomimage, g_nbtxtcomp, g_numtxtcomp, g_analyse_path, g_analyse_cast_at, g_analyse_sprite_picto_txtcomp, g_analyse_cast_picto_txtcomp, g_analyse_cast_picto_biblio, g_analyse_sprite_picto_biblio, g_analyse_sprite_picto_avatxt, g_analyse_cast_picto_avatxt, g_analyse_sprite_picto_rettxt, g_analyse_cast_picto_rettxt, g_biblio_actif, g_analyse_cast_dummy, g_analyse_extension_pct, g_analyse_extension_jpg, g_analyse_extension_aif, g_analyse_cast_picto_numpg, g_analyse_sprite_picto_numpg, g_analyse_sprite_picto_nbpg, g_analyse_cast_picto_separpg, g_analyse_sprite_picto_separpg, g_analyse_is_comp, g_analyse_hyptext, g_analyse_lien_dico, g_analyse_context, g_tempo, g_visite, g_call_param, g_direction, g_countcast, gCurseurOeil, gCurseurTexte, gCurseurPointer, gCurseurDoigt, gCurseurMainUp
  99.   if (g_visite = 1) and (g_analyse_status = 0) and (g_direction = "C") then
  100.     set g_analyse_status to 2
  101.     set g_direction to "X"
  102.   end if
  103.   set g_analyse_context to [nomimage, 3, g_nbtxtcomp, g_numtxtcomp]
  104.   if g_analyse_status = 0 then
  105.     set x to the mouseH
  106.     set y to the mouseV
  107.     if g_nbtxtcomp = 0 then
  108.       set info to value(line 2 of g_analyse_hyptext)
  109.     else
  110.       if g_biblio_actif = 0 then
  111.         set info to value(line 2 + g_numtxtcomp of g_analyse_hyptext)
  112.       else
  113.         set info to []
  114.       end if
  115.     end if
  116.     set g_analyse_lien_dico to EMPTY
  117.     repeat with i = 1 to count(info)
  118.       if inside(point(x, y), getAt(getAt(info, i), 1)) = 1 then
  119.         set g_analyse_lien_dico to getAt(getAt(info, i), 2)
  120.         put "lien = ", g_analyse_lien_dico
  121.         exit repeat
  122.       end if
  123.     end repeat
  124.   end if
  125.   if g_analyse_status = 1 then
  126.     cursor(4)
  127.     puppetSprite(g_analyse_sprite_aa, 0)
  128.     puppetSprite(g_analyse_sprite_at, 0)
  129.     puppetSprite(g_analyse_sprite_ap, 0)
  130.     puppetSprite(g_analyse_sprite_ak, 0)
  131.     puppetSprite(g_analyse_sprite_picto_txtcomp, 0)
  132.     puppetSprite(g_analyse_sprite_picto_biblio, 0)
  133.     puppetSprite(g_analyse_sprite_picto_avatxt, 0)
  134.     puppetSprite(g_analyse_sprite_picto_rettxt, 0)
  135.     puppetSprite(g_analyse_sprite_picto_numpg, 0)
  136.     puppetSprite(g_analyse_sprite_picto_nbpg, 0)
  137.     puppetSprite(g_analyse_sprite_picto_separpg, 0)
  138.     if g_analyse_is_comp then
  139.       puppetSprite(g_analyse_sprite_picto_txtcomp, 0)
  140.     end if
  141.     set g_analyse_status to 0
  142.     go(1)
  143.   else
  144.     if g_analyse_status = 2 then
  145.       countComp(nomimage)
  146.       set g_nbtxtcomp to g_countcast
  147.       if g_numtxtcomp = 0 then
  148.         set g_numtxtcomp to 1
  149.       end if
  150.       set g_biblio_actif to 0
  151.       set the regPoint of cast (g_analyse_cast_picto_txtcomp + 1) to point(0, 0)
  152.       set the castNum of sprite g_analyse_sprite_picto_txtcomp to g_analyse_cast_picto_txtcomp + 1
  153.       set the locH of sprite g_analyse_sprite_picto_txtcomp to 200
  154.       set the locV of sprite g_analyse_sprite_picto_txtcomp to 440
  155.       puppetSprite(g_analyse_sprite_picto_separpg, 1)
  156.       set the castNum of sprite g_analyse_sprite_picto_separpg to g_analyse_cast_picto_separpg
  157.       set the stretch of sprite g_analyse_sprite_picto_separpg to 0
  158.       set the locH of sprite g_analyse_sprite_picto_separpg to 512
  159.       set the locV of sprite g_analyse_sprite_picto_separpg to 470
  160.       set g_analyse_status to 4
  161.       go(the frame)
  162.     else
  163.       if g_analyse_status = 3 then
  164.         set g_nbtxtcomp to 0
  165.         set g_numtxtcomp to 0
  166.         if the machineType = 256 then
  167.           set at to the pathName & "AN\AT\" & nomimage & "AT" & g_analyse_extension_jpg
  168.         else
  169.           set at to the pathName & "AN:AT:" & nomimage & "AT" & g_analyse_extension_jpg
  170.         end if
  171.         set g_analyse_cast_at to the number of member (nomimage & "AT.RTF")
  172.         set the castNum of sprite g_analyse_sprite_at to g_analyse_cast_at
  173.         set the castNum of sprite g_analyse_sprite_picto_txtcomp to g_analyse_cast_picto_txtcomp
  174.         puppetSprite(g_analyse_sprite_picto_biblio, 0)
  175.         puppetSprite(g_analyse_sprite_picto_avatxt, 0)
  176.         puppetSprite(g_analyse_sprite_picto_rettxt, 0)
  177.         puppetSprite(g_analyse_sprite_picto_numpg, 0)
  178.         puppetSprite(g_analyse_sprite_picto_nbpg, 0)
  179.         puppetSprite(g_analyse_sprite_picto_separpg, 0)
  180.         set g_analyse_status to 0
  181.         go(the frame)
  182.       else
  183.         if g_analyse_status = 4 then
  184.           if g_biblio_actif = 1 then
  185.             set g_analyse_cast_at to the number of member ("BB" & g_numtxtcomp & ".RTF")
  186.             put "name   = ", "BB" & g_numtxtcomp & ".RTF"
  187.           else
  188.             set g_analyse_cast_at to the number of member (nomimage & "AC" & g_numtxtcomp & ".RTF")
  189.             put "name   = ", nomimage & "AC" & g_numtxtcomp & ".RTF"
  190.           end if
  191.           set the castNum of sprite g_analyse_sprite_at to g_analyse_cast_at
  192.           if g_biblio_actif = 0 then
  193.             puppetSprite(g_analyse_sprite_picto_biblio, 1)
  194.             set the castNum of sprite g_analyse_sprite_picto_biblio to g_analyse_cast_picto_biblio
  195.             set the stretch of sprite g_analyse_sprite_picto_biblio to 0
  196.             set the locH of sprite g_analyse_sprite_picto_biblio to 260
  197.             set the locV of sprite g_analyse_sprite_picto_biblio to 455
  198.           end if
  199.           if g_numtxtcomp < g_nbtxtcomp then
  200.             set the regPoint of cast g_analyse_cast_picto_avatxt to point(0, 0)
  201.             puppetSprite(g_analyse_sprite_picto_avatxt, 1)
  202.             set the castNum of sprite g_analyse_sprite_picto_avatxt to g_analyse_cast_picto_avatxt
  203.             set the stretch of sprite g_analyse_sprite_picto_avatxt to 0
  204.             set the locH of sprite g_analyse_sprite_picto_avatxt to 520
  205.             set the locV of sprite g_analyse_sprite_picto_avatxt to 460
  206.           else
  207.             puppetSprite(g_analyse_sprite_picto_avatxt, 0)
  208.           end if
  209.           if g_numtxtcomp > 1 then
  210.             set the regPoint of cast g_analyse_cast_picto_rettxt to point(0, 0)
  211.             puppetSprite(g_analyse_sprite_picto_rettxt, 1)
  212.             set the castNum of sprite g_analyse_sprite_picto_rettxt to g_analyse_cast_picto_rettxt
  213.             set the stretch of sprite g_analyse_sprite_picto_rettxt to 0
  214.             set the locH of sprite g_analyse_sprite_picto_rettxt to 485
  215.             set the locV of sprite g_analyse_sprite_picto_rettxt to 460
  216.           else
  217.             puppetSprite(g_analyse_sprite_picto_rettxt, 0)
  218.           end if
  219.           puppetSprite(g_analyse_sprite_picto_numpg, 1)
  220.           set the castNum of sprite g_analyse_sprite_picto_numpg to g_analyse_cast_picto_numpg + g_numtxtcomp
  221.           set the stretch of sprite g_analyse_sprite_picto_numpg to 0
  222.           set the locH of sprite g_analyse_sprite_picto_numpg to 507
  223.           set the locV of sprite g_analyse_sprite_picto_numpg to 470
  224.           set the visible of sprite g_analyse_sprite_picto_numpg to 0
  225.           updateStage()
  226.           set the visible of sprite g_analyse_sprite_picto_numpg to 1
  227.           puppetSprite(g_analyse_sprite_picto_nbpg, 1)
  228.           set the castNum of sprite g_analyse_sprite_picto_nbpg to g_analyse_cast_picto_numpg + g_nbtxtcomp
  229.           set the stretch of sprite g_analyse_sprite_picto_nbpg to 0
  230.           set the locH of sprite g_analyse_sprite_picto_nbpg to 518
  231.           set the locV of sprite g_analyse_sprite_picto_nbpg to 470
  232.           set the visible of sprite g_analyse_sprite_picto_nbpg to 0
  233.           updateStage()
  234.           set the visible of sprite g_analyse_sprite_picto_nbpg to 1
  235.           set g_analyse_status to 0
  236.           go(the frame)
  237.         else
  238.           if g_analyse_status = 5 then
  239.             set g_nbtxtcomp to 9
  240.             set g_numtxtcomp to 1
  241.             puppetSprite(g_analyse_sprite_picto_biblio, 1)
  242.             set the castNum of sprite g_analyse_sprite_picto_biblio to g_analyse_cast_picto_biblio + 1
  243.             set g_analyse_status to 4
  244.             go(the frame)
  245.           else
  246.             if g_analyse_status = 6 then
  247.               set the castNum of sprite g_analyse_sprite_picto_biblio to g_analyse_cast_picto_biblio
  248.               set g_analyse_status to 4
  249.               go(the frame)
  250.             else
  251.               go(the frame)
  252.             end if
  253.           end if
  254.         end if
  255.       end if
  256.     end if
  257.   end if
  258.   if (g_visite = 1) and (g_analyse_status = 0) then
  259.     updateStage()
  260.     set curtime to the timer
  261.     repeat while the timer < (curtime + (60 * g_tempo))
  262.       if the mouseDown then
  263.         set g_call_param to -1
  264.         set g_exit to 0
  265.         unpuppet()
  266.         go("sortie")
  267.         exit repeat
  268.       end if
  269.     end repeat
  270.     set g_exit to 0
  271.     unpuppet()
  272.     go("sortie")
  273.   end if
  274.   if rollOver(g_analyse_sprite_ap) then
  275.     cursor(gCurseurOeil)
  276.   else
  277.     if rollOver(g_analyse_sprite_picto_biblio) or rollOver(g_analyse_sprite_picto_txtcomp) then
  278.       cursor(gCurseurTexte)
  279.     else
  280.       if rollOver(g_analyse_sprite_picto_manitool) then
  281.         cursor(gCurseurPointer)
  282.       else
  283.         if rollOver(g_analyse_sprite_picto_retuniv) or rollOver(g_analyse_sprite_picto_avatxt) or rollOver(g_analyse_sprite_picto_rettxt) or (g_analyse_lien_dico <> EMPTY) then
  284.           cursor(gCurseurDoigt)
  285.         else
  286.           if rollOver(47) then
  287.             cursor(gCurseurMainUp)
  288.           else
  289.             cursor(-1)
  290.           end if
  291.         end if
  292.       end if
  293.     end if
  294.   end if
  295. end
  296.  
  297. on message_d7
  298.   global xmsg
  299.   set xmsg to "Hypertext Links give you quick and easy access to detailed information on the most frequently used terminology in the CD-ROM. These do not function in this demo."
  300.   open(window "demo")
  301.   repeat while the mouseDown = 1
  302.     updateStage()
  303.   end repeat
  304.   repeat while the mouseDown = 0
  305.     updateStage()
  306.   end repeat
  307.   repeat while the mouseDown = 1
  308.     updateStage()
  309.   end repeat
  310.   close(window "demo")
  311. end
  312.